package com.wxzz.elearing.evaluation.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wxzz.elearing.evaluation.dto.*;
import com.wxzz.elearing.evaluation.entity.*;
import com.wxzz.elearing.evaluation.vo.CredentialListVo;
import com.wxzz.elearning.common.vo.JgPageVo;
import com.wxzz.elearning.common.vo.ReturnVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 工厂体检/星级认证 服务类
 * </p>
 *
 * @author
 * @since 2021-04-10
 */
public interface IBusinessCategoryRuleService extends IService<BusinessCategoryRule> {

    /**
     * 添加工厂体检
     *
     * @param businessCategoryRule
     * @return
     */
    ReturnVO saveBusinessCategoryRule(BusinessCategoryRule businessCategoryRule);

    /**
     * 根据id删除工厂体检/星级认证
     *
     * @param businessCategoryRuleId
     * @return
     */
    ReturnVO deleteBusinessCategoryRuleById(Long businessCategoryRuleId);

    /**
     * 添加星级认证
     *
     * @param businessCategoryRule
     * @return
     */
    ReturnVO saveBusinessCategoryRule4start(BusinessCategoryRule businessCategoryRule);

    /**
     * 根据微信用户id查询最高星级(远程调用)
     * @param wxUserId
     * @return
     */
    Integer selectTopStarByWxUserId(Long wxUserId);

    /**
     * 工厂体检/星级认证列表
     *
     * @param type                    0-工厂体检 1-星级认证
     * @param businessCategoryRuleDto
     * @return
     */
    ReturnVO<JgPageVo<List<BusinessCategoryRule>>> listBusinessCategoryRule(Integer type, BusinessCategoryRuleDto businessCategoryRuleDto);

    /**
     * 添加题库
     *
     * @param type                        0-工厂体检 1-星级认证 2-能力测评
     * @param businessCategoryTopicInsDto
     * @return
     */
    ReturnVO saveBusinessCategoryTopic(Integer type, BusinessCategoryTopicInsDto businessCategoryTopicInsDto);

    /**
     * 查询星级认证项目(小程序)
     *
     * @param wxBusinessCategoryRuleDto
     * @return
     */
    ReturnVO<JgPageVo<List<BusinessCategoryRule>>> listBusinessCategoryRuleByCategory(Long wxUserId, WxBusinessCategoryRuleDto wxBusinessCategoryRuleDto);

    /**
     * 工厂体检/星级认证历史查询
     *
     * @param businessCategoryRuleHistoryDto
     * @return
     */
    ReturnVO<JgPageVo<List<BusinessCategoryRuleHistory>>> listBusinessCategoryRuleHistory(BusinessCategoryRuleHistoryDto businessCategoryRuleHistoryDto);

    /***
     * 查询星级认证详情
     * @param businessCategoryRuleId
     * @return
     */
    ReturnVO<BusinessCategoryRule> selectBusinessCategoryRuleById(JSONObject jsonObject, Long businessCategoryRuleId);

    /**
     * 添加或修改星级认证班组(后台)
     *
     * @return
     */
    ReturnVO saveBusinessCategoryRuleGroup(Long enterpriseId, BusinessCategoryRuleGroupInsDto businessCategoryRuleGroupInsDto);


    /**
     * 根据星级班组id查询绑定的人员(后台)
     *
     * @return
     */
    ReturnVO<JgPageVo<WxUserBusinessCategoryGroup>> selectWxUserBusinessCategoryGroupByBusinessCategoryRuleGroupId(Long enterpriseId, WxUserBusinessCategoryGroupDto wxUserBusinessCategoryGroupDto);

    /**
     * 列出星级认证班组(后台)
     *
     * @param businessCategoryRuleGroupDto
     * @return
     */
    ReturnVO<JgPageVo<List<BusinessCategoryRuleGroup>>> listBusinessCategoryRuleGroup(Long enterpriseId, BusinessCategoryRuleGroupDto businessCategoryRuleGroupDto);

    /**
     * 分配工厂体检人员(后台)
     *
     * @param enterpriseId
     * @param wxUserBusinessCategoryGroup4factoryDto
     * @return
     */
    ReturnVO saveWxUserBusinessCategoryGroup4factory(Long enterpriseId, WxUserBusinessCategoryGroup4factoryDto wxUserBusinessCategoryGroup4factoryDto);

    /**
     * 查询工厂体检绑定人员(后台)
     * @param enterpriseId
     * @param selectFactoryBindDto
     * @return
     */
    ReturnVO selectFactoryBind(Long enterpriseId,SelectFactoryBindDto selectFactoryBindDto);

    /**
     * 查询用户最高的星级认证星级
     * @param wxUserId
     * @return
     */
    Integer selectWxUserStart(Long wxUserId);

    /**
     * 查询星级认证证书
     * @param jsonObject
     * @return
     */
    ReturnVO<CredentialListVo> selectCredentialListVo(JSONObject jsonObject);

    /**
     * 查询该企业的班组英雄榜
     * @param enterpriseId
     * @param businessCategoryRuleGroupStatisticsDataByGroupDto
     * @return
     */
    ReturnVO<JgPageVo<List<BusinessCategoryRuleGroupStatisticsData>>> selectBusinessCategoryRuleGroupStatisticsDataByGroup(HttpServletResponse response, Long enterpriseId, BusinessCategoryRuleGroupStatisticsDataByGroupDto businessCategoryRuleGroupStatisticsDataByGroupDto);
}
